
obj-m := pf_ring.o

KERNEL_VER ?= 2.6.35.10

SVNDEF := -DSVN_REV="\"$(shell svnversion -n .)\""
EXTRA_CFLAGS += -I$(PWD) $(SVNDEF)

HERE=$(PWD)

# set the install path
INSTDIR := $(DESTDIR)/lib/modules/$(KERNEL_VER)/kernel/net/pf_ring
TARGETDIR := /usr/src/$(KERNEL_VER)/include/linux/

all: Makefile pf_ring.c linux/pf_ring.h
	@if test "$(USER)" = "root"; then \
		echo "********** WARNING WARNING WARNING **********"; \
		echo "*"; \
		echo "* Compiling PF_RING as root might lead you to compile errors"; \
		echo "* Please compile PF_RING as unpriviliged user"; \
		echo "*"; \
		echo "*********************************************"; \
	fi
	make -C /home/baiyu/Bdragonet/apps/kernel/linux-$(KERNEL_VER) SUBDIRS=$(HERE) EXTRA_CFLAGS='$(EXTRA_CFLAGS)' modules

clean:
	make -C /home/baiyu/Bdragonet/apps/kernel/linux-$(KERNEL_VER) SUBDIRS=$(HERE) clean

